<template>
  <div class="tag-wrapper">
    <template>
      <main-header />
      <div :style="{ 'min-height': documentClientHeight + 'px' }">
        <main-content />
      </div>
    </template>
  </div>
</template>

<script>
import MainHeader from './main-header-item'
import MainContent from './main-content-item'
export default {
  components: {
    MainHeader,
    MainContent
  },
  data() {
    return {}
  },
  computed: {
    loading() {
      return !this.$store.state.user.init
    },
    documentClientHeight: {
      get() {
        return this.$store.state.common.documentClientHeight
      },
      set(val) {
        this.$store.commit('common/updateDocumentClientHeight', val)
      }
    }
  },
  mounted() {
    this.resetDocumentClientHeight()
  },
  methods: {
    // 重置窗口高度
    resetDocumentClientHeight() {
      this.documentClientHeight = document.documentElement['clientHeight']
      window.onresize = () => {
        this.documentClientHeight = document.documentElement['clientHeight']
      }
    }
  }
}
</script>

<style lang="scss"></style>
